package com.livesource.client.web.repositoryLogin;

import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.livesource.client.utilities.FormField;

/**
 * 
 * @UserInterface
 */
public class RepositoryLoginPopup extends PopupPanel {

	public static final TextBox username = new TextBox();

	public static final PasswordTextBox password = new PasswordTextBox();

	public RepositoryLoginPopup(final String projectID) {

		VerticalPanel vp = new VerticalPanel();

		vp.setSpacing(10);

		vp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);

		vp.add(new ButtonClose(this));

		vp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);

		vp.add(new Label(
				"Please enter your remote repository authentication info:"));

		vp.add(FormField.getFormField("Username", username));

		vp.add(FormField.getFormField("Password", password));

		vp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

		vp.add(new ButtonSave(projectID, this));

		this.add(vp);

		this.center();

		this.show();
	}

}
